//调用接口配置文件
import { request } from 'config/request'

// 修改优惠券状态
export async function updateCoupon(params) {
	return request({
		url: 'admin/coupons/config/state',
		method: 'POST',
		data: params
	});
};

// 删除优惠券
export async function deleteCoupon(params) {
	return request({
		url: 'admin/coupons/config/delete',
		method: 'GET',
		data: params
	});
};

// 导出优惠券
export async function exportCoupon(params) {
	return request({
		url: `admin/coupons/export/${params.couponsConfigId}`,
		method: 'GET',
		data: undefined
	});
};

// 导入优惠券
export async function importCoupon(params) {
	return request({
		url: 'admin/coupons/import',
		method: 'POST',
		headers: {
			"Content-type": "application/x-www-form-urlencoded"
		},
		data: params
	});
};